package com.tcoiss.kettle.api.factory;

import com.tcoiss.kettle.api.RemoteKettleJobService;
import com.tcoiss.kettle.api.request.JobReq;
import com.tcoiss.kettle.api.response.JobRes;
import com.tcoiss.kettle.common.povo.PageOut;
import com.tcoiss.kettle.common.povo.QueryHelper;
import com.tcoiss.kettle.common.povo.Result;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class RemoteKettleJobFallbackFactory implements FallbackFactory<RemoteKettleJobService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteKettleJobFallbackFactory.class);
    @Override
    public RemoteKettleJobService create(Throwable throwable)
    {
        log.error("kettle作业服务调用失败:{}", throwable.getMessage());
        return new RemoteKettleJobService()
        {

            @Override
            public Result<PageOut<JobRes>> findJobListByPage(QueryHelper<JobReq> req) {
                return null;
            }

            @Override
            public Result startAllJob() {
                return null;
            }

            @Override
            public Result startJob(Integer id) {
                return null;
            }

            @Override
            public Result stopAllJob() {
                return null;
            }

            @Override
            public Result stopJob(Integer id) {
                return null;
            }


        };
    }


}
